package uit.uthuoc.dal;

import java.util.ArrayList;

public class DrugDAO {
	private ArrayList<DrugDTO> mDrugs;
	
	private static DrugDAO sDrugDAO;
	
	private DrugDAO() {
		mDrugs = new ArrayList<DrugDTO>();
		
		for (int i = 0; i < 100; i++) {
			DrugDTO temp = new DrugDTO();
			temp.setName("Drug #" + i);
			mDrugs.add(temp);
		}
	}
	
	public static DrugDAO getDAO() {
		if (sDrugDAO == null) {
			sDrugDAO = new DrugDAO();
		}
		
		return sDrugDAO;
	}
	
	public ArrayList<DrugDTO> getList() {
		return mDrugs;
	}
	
	public DrugDTO getDrug(int index) {
		return mDrugs.get(index);
	}
}
